package poo.sortable;

public abstract class Sortable {

	protected abstract int compareTo(Sortable x);

	public static void sort(Sortable[] v) {
		for (int j = v.length - 1; j > 0; j--) {
			int imax = 0;
			for (int i = 0; i <= j; i++) 
				if (v[i].compareTo(v[imax]) > 0)
					imax = i;
				// scambia
				Sortable park = v[j];
				v[j] = v[imax];
				v[imax] = park;
			}// for
		}// sort
	}//Sortable

